import { createRouter, createWebHashHistory} from 'vue-router'
//一级组件
import AdmVue from "../views/adm/Adm.vue";
import Stu_MainVue from "../views/stu/Main.vue";
import Tea_MainVue from "../views/tea/Main.vue";
//公共组件
import Login from "@/views/Login.vue";//登录组件
import Pwd from "@/views/Pwd.vue";//修改密码组件
import Header from "@/views/Header.vue";//修改头像组件
//二级组件————管理员
import Adm_Stu_AddVue from "../views/adm/stu/Add.vue";
import Adm_Stu_ShowVue from "../views/adm/stu/Show.vue";
import Adm_Tea_AddVue from "../views/adm/tea/Add.vue";
import Adm_Tea_ShowVue from "../views/adm/tea/Show.vue";
import Adm_ClzVue from "../views/adm/Clz.vue";
import Adm_CourseVue from "../views/adm/Course.vue";
import Adm_TaskVue from "../views/adm/Task.vue";
//二级组件————学生
import Stu_MyMarkVue from "../views/stu/MyMark.vue";
import Stu_MyCourseVue from "../views/stu/MyCourse.vue";
//二级组件————教师
import Tea_GoMarkVue from "../views/tea/GoMark.vue";
import Tea_DoMarkVue from "../views/tea/DoMark.vue";


const routes = [
	{
		path:"/login",
		component:Login
	},
	{
		path:"/adm",
		component:AdmVue,
		children:[
			{
				path:"addstu",
				component:Adm_Stu_AddVue,
			},
			{
				path:"showStu",
				component:Adm_Stu_ShowVue,
			},
			{
				path:"addtea",
				component:Adm_Tea_AddVue,
			},
			{
				path:"showTea",
				component:Adm_Tea_ShowVue,
			},
			{
				path:"clz",
				component:Adm_ClzVue,
			},
			{
				path:"course",
				component:Adm_CourseVue,
			},
			{
				path:"task",
				component:Adm_TaskVue,
			},
			{
				path:"header",
				component:Header
			}
		]
	},
	{
		path:"/stu",
		component:Stu_MainVue,
		children:[
			{
				path:"myMark",
				component:Stu_MyMarkVue
			},
			{
				path:"myCourse",
				component:Stu_MyCourseVue
			},
			{
				path:"pwd",
				component:Pwd
			},
			{
				path:"header",
				component:Header
			}
		]
	},
	{
		path:"/tea",
		component:Tea_MainVue,
		children:[
			{
				path:"goMark",
				component:Tea_GoMarkVue
			},
			{
				path:"doMark",
				component:Tea_DoMarkVue
			},
			{
				path:"pwd",
				component:Pwd
			},
			{
				path:"header",
				component:Header
			}
		]
	}
	
	
]


// 注册路由表   告诉 Vue-router 路由数组
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes
})

//export  暴露出来，为 import
export default router